/*
 * Copyright (C) 2013 Daniel Wasilew <daniel.wasilew@codeminer.org>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.codeminer.parts.files;

import java.io.File;
import java.util.EnumMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.codeminer.parts.library.Song;

/**
 *
 * @author Daniel Wasilew <daniel.wasilew@codeminer.org>
 */
public class ProcessInfo {
    
    public static enum TrackKeys {
        SONG, FILE, DURATION, BITRATE, CHANNELS, FORMAT, ARTIST, ALBUM, YEAR, TITLE, GENRE, TRACK
    }

    private final List<byte[]> artworks = new LinkedList<>();
    private final Map<TrackKeys, Object> properties = new EnumMap<>(TrackKeys.class);

    public ProcessInfo(File file) {
        this.properties.put(TrackKeys.FILE, file);
    }

    public List<byte[]> getArtworks() {
        return artworks;
    }
    
    public File getFile() {
        return (File) this.properties.get(TrackKeys.FILE);
    }
    
    String getStringValue(TrackKeys key) {
        return (String) this.properties.get(key);
    }
    
    Integer getIntegerValue(TrackKeys key) {
        return (Integer) this.properties.get(key);
    }
    
    void put(TrackKeys key, Object value) {
        this.properties.put(key, value);
    }
    
    Song getSong() {
        return (Song) this.properties.get(TrackKeys.SONG);
    }
    
    void addArtwork(byte[] binaryData) {
        this.artworks.add(binaryData);
    }


}
